package com.fool
{
	import mx.collections.ArrayCollection;

	public class Table implements ISerializable
	{
		[Bindable]
		public var source:ArrayCollection = new ArrayCollection();
		
		public function clear():void
		{
			source.removeAll();//Ruby .clear
		}
		
		public function reciveAll():ArrayCollection
		{
			var result:ArrayCollection = new ArrayCollection();
			result.addAll(source);
			clear();
			return result;
		}
		
		public function put(card:Card):void
		{
			source.addItem(card);
		}
		
		public function getData():Array
		{
			return source.source;
		}
		
		public function deSerialize(value:String):void
		{
			var arr:Array = value.split(Enum.SEQUENCE_DELIMITER);
			source = new ArrayCollection
		}
		
		public function serialize():String
		{
			return source.source.join(Enum.SEQUENCE_DELIMITER);
		}

	}
}